#ifndef TESTCASEMANAGER_H
#define TESTCASEMANAGER_H

#include <QObject>
#include <QList>
#include "datamodel.h"
#include "xmlparser.h"

class TestCaseManager : public QObject {
    Q_OBJECT

public:
    explicit TestCaseManager(QObject *parent = nullptr);

    QList<TestDataModel::TestCase> getTestCases() const;
    void setTestCases(const QList<TestDataModel::TestCase>& testCases);

    QList<TestDataModel::ConfigItem> getConfigData() const;

    bool addTestCase(const TestDataModel::TestCase& testCase);
    bool removeTestCases(const QList<int>& indices);
    bool updateTestCase(int index, const TestDataModel::TestCase& testCase);

    bool saveTestCases(const QList<TestDataModel::TestCase>& testCases = {});
    bool loadTestCases();
    bool loadConfigData();

private:
    QList<TestDataModel::TestCase> m_testCases;
    QList<TestDataModel::ConfigItem> m_configData;
};

#endif // TESTCASEMANAGER_H
